<?xml version='1.0' encoding='UTF-8' ?> 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:a4j="http://richfaces.org/a4j"
                xmlns:rich="http://richfaces.org/rich"
                template="layout_2.xhtml"
                xmlns:f="http://java.sun.com/jsf/core">

    <ui:define name="content">
        <f:view>
            <h:form id="form" >
                <rich:panel header="Dodaj autora" style="width:100%; text-align:center;" >
                    <h:panelGrid columns="3">                      
                        <h:outputText value="Imię:"/>
                        <h:inputText value="#{dodajAutora.imie}" id="name" style="width:200px;" validatorMessage="Imię nie może być puste">
                            <f:validateLength minimum="0" />
                            <f:validateRequired />
                            <rich:validator />
                        </h:inputText>
                        <rich:message for="name" style="color:red"/>
                        <h:outputText value="Nazwisko:"/>
                        <h:inputText value="#{dodajAutora.nazwisko}" id="surname" style="width:200px;" validatorMessage="Nazwisko nie może być puste">
                            <f:validateLength minimum="0" />
                            <f:validateRequired />
                            <rich:validator />
                        </h:inputText>
                        <rich:message for="surname" style="color:red"/>
                        <h:commandButton value="Dodaj" style="width:100px;" action="#{dodajAutora.dodaj}"/>
                    </h:panelGrid>
                </rich:panel>
            </h:form>
        </f:view>
    </ui:define>

</ui:composition>
